package xyz.zcxsythenew.example.demo

import java.io.InputStream
import java.io.InputStreamReader

object StreamToString {
    fun readStream(inputStream: InputStream?): String? {
        val reader = InputStreamReader(inputStream, "GBK")
        var str = reader.readText()
        var res = ""
        while (str != "") {
            res += str
            str = reader.readText()
        }
        return res
    }
}